package com.wanda.common;

import com.wanda.entity.Movie;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author sky
 * @date 2022-08-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class R<T> {
    private String code;
    private String message;
    private T data;

    public R(ResponseEnum responseEnum, List<Movie> movies) {
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMessage();
        this.data = (T) movies;
    }
}
